/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "custom_responses" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "CustomResponses.findAll" , query = "SELECT c FROM CustomResponses c" ) ,
    @NamedQuery( name = "CustomResponses.findByResponsesId" , query = "SELECT c FROM CustomResponses c WHERE c.responsesId = :responsesId" ) ,
    @NamedQuery( name = "CustomResponses.findByItemId" , query = "SELECT c FROM CustomResponses c WHERE c.itemId = :itemId" ) ,
    @NamedQuery( name = "CustomResponses.findByOccurrenceSequence" , query = "SELECT c FROM CustomResponses c WHERE c.occurrenceSequence = :occurrenceSequence" ) ,
    @NamedQuery( name = "CustomResponses.findByDeId" , query = "SELECT c FROM CustomResponses c WHERE c.deId = :deId" ) ,
    @NamedQuery( name = "CustomResponses.findByAgIdDc" , query = "SELECT c FROM CustomResponses c WHERE c.agIdDc = :agIdDc" ) ,
    @NamedQuery( name = "CustomResponses.findByKeycode" , query = "SELECT c FROM CustomResponses c WHERE c.keycode = :keycode" ) ,
    @NamedQuery( name = "CustomResponses.findByResponseLabel" , query = "SELECT c FROM CustomResponses c WHERE c.responseLabel = :responseLabel" ) ,
    @NamedQuery( name = "CustomResponses.findByResponseInstruction" , query = "SELECT c FROM CustomResponses c WHERE c.responseInstruction = :responseInstruction" ) ,
    @NamedQuery( name = "CustomResponses.findByCreatedBy" , query = "SELECT c FROM CustomResponses c WHERE c.createdBy = :createdBy" ) ,
    @NamedQuery( name = "CustomResponses.findByDateCreated" , query = "SELECT c FROM CustomResponses c WHERE c.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "CustomResponses.findByModifiedBy" , query = "SELECT c FROM CustomResponses c WHERE c.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "CustomResponses.findByDateModified" , query = "SELECT c FROM CustomResponses c WHERE c.dateModified = :dateModified" )
} )
public class CustomResponses implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "responses_id" )
    private String responsesId;
    @Basic( optional = false )
    @Column( name = "item_id" )
    private String itemId;
    @Column( name = "occurrence_sequence" )
    private BigInteger occurrenceSequence;
    @Basic( optional = false )
    @Column( name = "de_id" )
    private String deId;
    @Column( name = "ag_id_dc" )
    private String agIdDc;
    @Column( name = "keycode" )
    private String keycode;
    @Column( name = "response_label" )
    private String responseLabel;
    @Column( name = "response_instruction" )
    private String responseInstruction;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @JoinColumn( name = "ag_id_paper" , referencedColumnName = "ag_id" )
    @ManyToOne
    private PaperAttributeGroup agIdPaper;
    @JoinColumn( name = "ag_id_electronic" , referencedColumnName = "ag_id" )
    @ManyToOne
    private ElectronicAttributeGroup agIdElectronic;


    public CustomResponses()
    {
    }


    public CustomResponses( String responsesId )
    {
        this.responsesId = responsesId;
    }


    public CustomResponses( String responsesId , String itemId , String deId , String createdBy , Date dateCreated )
    {
        this.responsesId = responsesId;
        this.itemId = itemId;
        this.deId = deId;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
    }


    public String getResponsesId()
    {
        return responsesId;
    }


    public void setResponsesId( String responsesId )
    {
        this.responsesId = responsesId;
    }


    public String getItemId()
    {
        return itemId;
    }


    public void setItemId( String itemId )
    {
        this.itemId = itemId;
    }


    public BigInteger getOccurrenceSequence()
    {
        return occurrenceSequence;
    }


    public void setOccurrenceSequence( BigInteger occurrenceSequence )
    {
        this.occurrenceSequence = occurrenceSequence;
    }


    public String getDeId()
    {
        return deId;
    }


    public void setDeId( String deId )
    {
        this.deId = deId;
    }


    public String getAgIdDc()
    {
        return agIdDc;
    }


    public void setAgIdDc( String agIdDc )
    {
        this.agIdDc = agIdDc;
    }


    public String getKeycode()
    {
        return keycode;
    }


    public void setKeycode( String keycode )
    {
        this.keycode = keycode;
    }


    public String getResponseLabel()
    {
        return responseLabel;
    }


    public void setResponseLabel( String responseLabel )
    {
        this.responseLabel = responseLabel;
    }


    public String getResponseInstruction()
    {
        return responseInstruction;
    }


    public void setResponseInstruction( String responseInstruction )
    {
        this.responseInstruction = responseInstruction;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public PaperAttributeGroup getAgIdPaper()
    {
        return agIdPaper;
    }


    public void setAgIdPaper( PaperAttributeGroup agIdPaper )
    {
        this.agIdPaper = agIdPaper;
    }


    public ElectronicAttributeGroup getAgIdElectronic()
    {
        return agIdElectronic;
    }


    public void setAgIdElectronic( ElectronicAttributeGroup agIdElectronic )
    {
        this.agIdElectronic = agIdElectronic;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( responsesId != null ? responsesId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof CustomResponses ) )
        {
            return false;
        }
        CustomResponses other = (CustomResponses) object;
        if ( ( this.responsesId == null && other.responsesId != null ) || ( this.responsesId != null && !this.responsesId.equals( other.responsesId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.CustomResponses[ responsesId=" + responsesId + " ]";
    }
    
}
